using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.SupplyChain.Warehouse;
using HengTong.Model;


namespace HengTong.ViewModel.SupplyChain.SysWarehouseAreaVms
{
    public partial class SysWarehouseAreaTemplateVm : BaseTemplateVM
    {
        [Display(Name = "库区名称")]
        public ExcelPropety NameExcel = ExcelPropety.CreateProperty<SysWarehouseArea>(x => x.Name);
        [Display(Name = "库区编码")]
        public ExcelPropety CodeExcel = ExcelPropety.CreateProperty<SysWarehouseArea>(x => x.Code);
        [Display(Name = "ERP编号")]
        public ExcelPropety ErpIdExcel = ExcelPropety.CreateProperty<SysWarehouseArea>(x => x.ErpId);
        [Display(Name = "所属仓库")]
        public ExcelPropety WarehouseExcel = ExcelPropety.CreateProperty<SysWarehouseArea>(x => x.WarehouseId);
        [Display(Name = "描述")]
        public ExcelPropety DescriptionExcel = ExcelPropety.CreateProperty<SysWarehouseArea>(x => x.Description);
        [Display(Name = "状态")]
        public ExcelPropety CommonStateExcel = ExcelPropety.CreateProperty<SysWarehouseArea>(x => x.CommonState);
        [Display(Name = "_Admin.Parent")]
        public ExcelPropety ParentExcel = ExcelPropety.CreateProperty<SysWarehouseArea>(x => x.ParentId);

	    protected override void InitVM()
        {
            WarehouseExcel.DataType = ColumnDataType.ComboBox;
            WarehouseExcel.ListItems = DC.Set<SysWarehouse>().GetSelectListItems(Wtm, y => y.Name);
            ParentExcel.DataType = ColumnDataType.ComboBox;
            ParentExcel.ListItems = DC.Set<SysWarehouseArea>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysWarehouseAreaImportVm : BaseImportVM<SysWarehouseAreaTemplateVm, SysWarehouseArea>
    {

    }

}
